package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Customer;
import cn.wolfcode.domain.SysDictData;
import cn.wolfcode.mapper.SysDictDataMapper;
import cn.wolfcode.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by XuHangBin
 */
@Service
public class SysDictDataServiceImpl implements ISysDictDataService {

    @Autowired
    private SysDictDataMapper sysDictDataMapper;

    @Override
    public List<SysDictData> selectAll() {
        return sysDictDataMapper.selectAll();
    }

    public List<SysDictData> queryByType(String dict_type){
        return sysDictDataMapper.queryByType(dict_type);
    }

    @Override
    public void saveOrUpdate(SysDictData sysDictData) {
        if(sysDictData.getDict_code()==null){
            sysDictDataMapper.insert(sysDictData);
        }else{
            sysDictDataMapper.update(sysDictData);
        }
    }

    @Override
    public SysDictData get(Long dictCode) {
        return sysDictDataMapper.get(dictCode);
    }

    @Override
    public List<SysDictData> listAll(String schoolType) {
        return sysDictDataMapper.ListAll(schoolType);
    }


}
